package com.shycloud.mido.homework.controller;

import com.alibaba.fastjson.JSONObject;
import com.shycloud.mido.homework.api.entity.ZebraMockHomework;
import com.shycloud.mido.homework.service.ZebraMockHomeworkService;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * APP 端演示模式作业数据
 *
 * @author nianhua.jiang
 * @date 2021/11/17 13:37
 */
@Slf4j
@Api(tags = "APP 端演示模式作业数据")
@RestController
@AllArgsConstructor
@RequestMapping("/mock")
public class HomeworkMockController {

	private final ZebraMockHomeworkService mockHomeworkService;

	@GetMapping("getMockHomeworkList")
	public JSONObject getMockHomeworkList() {
		ZebraMockHomework mockHomework = mockHomeworkService.getById(1);
		JSONObject jsonObject = JSONObject.parseObject(mockHomework.getMockData());
		return jsonObject;
	}

}
